import request from "@/utils/request";

// 查询教学实验环境列表
export function listEnvironment(query) {
  return request({
    url: "/experiment/environment/list",
    method: "get",
    params: query,
  });
}

// 查询教学实验环境详细
export function getEnvironment(teachingEnvironmentId) {
  return request({
    url: "/experiment/environment/" + teachingEnvironmentId,
    method: "get",
  });
}

// 新增教学实验环境
export function addEnvironment(data) {
  return request({
    url: "/experiment/environment",
    method: "post",
    data: data,
  });
}

// 修改教学实验环境
export function updateEnvironment(data) {
  return request({
    url: "/experiment/environment",
    method: "put",
    data: data,
  });
}

// 删除教学实验环境
export function delEnvironment(teachingEnvironmentId) {
  return request({
    url: "/experiment/environment/" + teachingEnvironmentId,
    method: "delete",
  });
}

//生成环境实例
export function addEnvironmentExample(teachingEnvironmentId) {
  return request({
    url: "/experiment/environment/addExample/" + teachingEnvironmentId,
    method: "post",
  });
}
